**************************************************
*
* Paul Musgrave and Yu-Ming Liou
* rpm47@georgetown.edu and yl254@georgetown.edu
* 
* Created 28 February 2016
*
**************************************************

**************************************************
* Stata Housekeeping
**************************************************

clear all
capture log close
set more off

version 11.1

* Change to your valid directory
cd "/Users/paulmusgrave/Dropbox/0001 Academic Projects/Ongoing/0127 Oil Islam Women/ISQ Accepted Submission/Replication/Data/"
	
	
use "ISQ FINAL Data for Replication Analysis Appendix.dta"
tsset iso year

cd "../Drafts/Tables"


* * * * * * * * * * * * * * * * * * * * * * * * * 
*Clean up data
* * * * * * * * * * * * * * * * * * * * * * * * * 
*In levels this produces coefficients too small
*in its native form

gen oil1k = oil_gas_rentPOP/1000
lab var oil1k "Oil Income (in 1000s)"

* * * * * * * * * * * * * * * * * * * * * * * * * 
* Macros
* * * * * * * * * * * * * * * * * * * * * * * * * 

local rossmodel logGDPcap logGDPcap_sq age15_64

local rossmodelnolog logGDPcap age15_64


* * * * * * * * * * * * * * * * * * * * * * * * * 
* Replication, Fixed Effects, With Log Sq
* * * * * * * * * * * * * * * * * * * * * * * * * 

*** NOTE WELL that although our data comes from
* the 2008 paper our column definitions come from
* the 2012 book.

* p. 137, Table 4.5, column 1

xtregar laborfemale `rossmodel', fe
eststo Rep45col1

* p. 137, Table 4.5, column 2
xtregar laborfemale `rossmodel' oil1k, fe
eststo Rep45col2

* p. 137, Table 4.5, column 5
xtregar laborfemale `rossmodel' oil1k ///
if cty!="Saudi Arabia" & cty != "Kuwait", fe
eststo Rep45col5

* p. 137, Table 4.5, column 6
*xtregar laborfemale `rossmodel' oil1k ///
*if me_nafr==0, fe
*eststo Rep45col6

* p. 137, Table 4.5, column 7
* xtregar laborfemale `rossmodel' oil1k ///
* if me_nafr==1, fe
* eststo Rep45col7

* * * * * * * * * * * * * * * * * * * * * * * * * 
* Replication, Fixed Effects, Without Log Sq
* * * * * * * * * * * * * * * * * * * * * * * * * 


* p. 137, Table 4.5, column 1

xtregar laborfemale `rossmodelnolog', fe
eststo Rep45col12

* p. 137, Table 4.5, column 2
xtregar laborfemale `rossmodelnolog' oil1k, fe
eststo Rep45col22

* p. 137, Table 4.5, column 5
xtregar laborfemale `rossmodelnolog' oil1k ///
if cty!="Saudi Arabia" & cty != "Kuwait", fe
eststo Rep45col52


esttab Rep45col1 Rep45col2 Rep45col5 ///
Rep45col12 Rep45col22 Rep45col52 /// 
using ISQFINALAppendixTable08.tex, ///
 replace p label nomtitles ///
booktabs substitute({table} {sidewaystable}) ///
title("Replicating Ross, Using Fixed-Effects Models" \label{tab:rossrepli}) ///
addnotes("Dependent Variable is Female Labor Force Participation. Columns 1 through 3 use Ross's models " /// 
"with log-sq GDP); Columns 4 through 6 do not." )

esttab Rep45col1 Rep45col2 Rep45col5 ///
Rep45col12 Rep45col22 Rep45col52 /// 
using ISQFINALAppendixTable08.tex, ///
 replace p label ///
title("Replicating Ross, Using Fixed-Effects Models" \label{tab:rossrepli}) ///
addnotes("Dependent Variable is Female Labor Force Participation.")


**************************************************
* Stata Housekeeping
**************************************************

capture
